package ms.jasim.framework;

import ms.jasim.model.JasimModel;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;

public class UriProvider implements IUriProvider {
	@Override
	public URI getUri(JasimModel model) {
		EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(model);
		if (domain != null)
			return domain.getResourceSet().getResources().get(0).getURI();
		else if (model != null)
			return model.getURI();
		return null;
	}
}
